package com.cncytech.uiautomator_demo.testcase;

import com.cncytech.uiautomator_demo.BaseTest;
import com.cncytech.uiautomator_demo.RetryWatcher;
import com.cncytech.uiautomator_demo.TestConstant;
import com.cncytech.uiautomator_demo.utils.Describe;

import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.*;

import org.junit.Rule;
import org.junit.Test;

public class VoicePoliciesTest extends BaseTest {

    @Rule
    public RetryWatcher retryWatcher = new RetryWatcher(TestConstant.retryCount);

    @Test
    @Describe(TestConstant.VOICE_FORBIDDEN)
    public void voiceForbiddenTest() {
        String msg = TestConstant.VOICE_FORBIDDEN + TestConstant.FAILURE;
        int status = 0;
        assertThat(msg, tm.setVoicePolicies(status));
        int voicePolicies = tm.getVoicePolicies();
        assertThat(msg, voicePolicies, is(status));
    }


    @Test
    @Describe(TestConstant.VOICE_ENABLE)
    public void voiceEnableTest() {
        String msg = TestConstant.VOICE_ENABLE + TestConstant.FAILURE;
        int status = 1;
        assertThat(msg, tm.setVoicePolicies(status));
        int voicePolicies = tm.getVoicePolicies();
        assertThat(msg, voicePolicies, is(status));
    }
}
